﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Rodunu.Business.Interfaces;

namespace Rodunu.Clients.WPF.Settings
{
    /// <summary>
    /// Interaction logic for UserSettings.xaml
    /// </summary>
    public partial class UserSettings : UserControl
    {
        private readonly IManageSettings _manageSettings;

        public UserSettings(IManageSettings manageSettings)
        {
            InitializeComponent();

            _manageSettings = manageSettings;

            SettingsMenu.ProfileButton.Click += ProfileButton_Click;
            SettingsMenu.AccountsButton.Click += AccountsButton_Click;
        }

        void AccountsButton_Click(object sender, RoutedEventArgs e)
        {
            var accounts = new Accounts(_manageSettings);
            SetControlVisible(accounts);
        }

        void ProfileButton_Click(object sender, RoutedEventArgs e)
        {
            var profile = new Profile();
            SetControlVisible(profile);
        }

        private void SetControlVisible(UIElement element)
        {
            SettingsContent.Children.Clear();
            SettingsContent.Children.Add(element);
        }
    }
}
